package com.zxq.exchange;

public enum EFrame {

    /**
     * 未知
     */
    unknow(-1),

    /**
     * tcpmodbus 注册帧
     */
    sf_register(1),
    /**
     * com.zxq.frame.modbus
     */
    modbus(2),
    /**
     * 电表
     */
    dlt645(3),
    /**
     * com.zxq.frame.jt808
     */
    jt808(4),

    /**
     * 电力规约
     */
    iec_104(5);

    Integer value;
    EFrame(Integer i) {
        this.value = i;
    }

    public Integer getValue() {
        return value;
    }

    public static EFrame getType(Integer value){
        EFrame eFrame = EFrame.unknow;
        switch (value) {
            case 1:
                eFrame = EFrame.sf_register;
                break;
            case 2:
                eFrame = EFrame.modbus;
                break;
            case 3:
                eFrame = EFrame.dlt645;
                break;
            case 4:
                eFrame = EFrame.jt808;
                break;
            case 5:
                eFrame = EFrame.iec_104;
                break;
        }
        return eFrame;
    }






}
